<template>
  <view class="panel-box">
    <image :src="showData.imageUrl" mode="widthFix"></image>
    <view class="info-box">
      <view class="title">{{ showData.title }}</view>
      <view class="price-box">
        <text class="rmb">¥</text>
        <text class="price">{{ showData.price }}</text>
        <text class="price-old">¥{{ showData.oldPrice }}</text>
      </view>
      <view class="low-price">天天低价</view>
    </view>
  </view>
</template>

<script>
import { defineComponent, reactive, toRefs } from "vue";
export default defineComponent({
  name: "panel002",
  props: {
    showData: {
      type: Object,
      default: () => {
        return {
          id: 1,
          title: "Nike 运动透气包鞋",
          price: "149",
          oldPrice: "199",
          imageUrl: "/static/dataImage/weipinhui/001.webp",
        };
      },
    },
  },
  components: {},
  setup(props) {
    const data = reactive({});
    return {
      ...toRefs(data),
    };
  },
});
</script>

<style scoped lang="less">
.panel-box {
  background: #fff;
  border-radius: 20rpx;
  overflow: hidden;
  image {
    width: 100%;
    display: block;
  }
  .info-box {
    padding: 10rpx 20rpx;
    position: relative;
    .title {
      font-size: 28rpx;
      color: #000;
      // 显示2行多余省略号
      display: -webkit-box;
      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;
      overflow: hidden;
      font-weight: 400;
    }
    .status {
      font-size: 22rpx;
      color: #999;
      margin: 10rpx 0;
    }
    .logo-box {
      width: 70rpx;
      image {
        width: 100%;
      }
    }
    .price-box {
      // 文字横向底部对齐
      display: flex;
      // align-items: center;
      vertical-align: bottom;
      margin-top: 10rpx;
      .rmb {
        font-size: 22rpx;
        font-weight: 700;
        margin-right: 10rpx;
        color: #ff0777;
        margin-top: 5rpx;
        line-height: 44rpx;
      }
      .price {
        font-size: 32rpx;
        font-weight: 700;
        color: #ff0777;
      }
      .price-old {
        line-height: 40rpx;
        font-size: 22rpx;
        color: #999;
        margin-left: 10rpx;
        font-weight: 300;
        text-decoration: line-through;
      }
    }
    .low-price {
      font-size: 20rpx;
      color: #ff0777;
    }
  }
}
</style>
